package com.woniuxy.controller;

import com.woniuxy.service.ModelService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.config.ConfigurableBeanFactory;
import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;

/**
 * @Author: ideaAdmin
 * TODO: 测试 多例的注入 保证controller单例的情况下 注入service不是单例的
 * Date: 2022/2/13:14:54
 * Description:
 */
@Scope(ConfigurableBeanFactory.SCOPE_SINGLETON)
@Controller
@RequestMapping("/model")
public class PrototypeController {
    @Autowired
    private ModelService modelService;

    @RequestMapping("/singleton")
    public void test(String id) {
        modelService.print(id);

    }
}
